package cn.hesion.designpattern.Factory.SingleFactory;


import cn.hesion.designpattern.Factory.ICource;
import cn.hesion.designpattern.Factory.JavaCources;

public class Client {
    public static void main(String[] args) {
//        ICource javaCources = new JavaCources();
//        ICource pythonCources = new PythonCources();
//        javaCources.record();
//        pythonCources.record();
//        SingleCourceFactory singleCourceFactory = new SingleCourceFactory();
//        ICource cource = singleCourceFactory.create("python");
//        cource.record();
        //改进工厂反射
        CourceFactory courceFactory = new CourceFactory();
//        ICource cource = courceFactory.create("cn.hesion.designpattern.Factory.JavaCources");
//        cource.record();
        ICource cource = courceFactory.create(JavaCources.class);
        cource.record();
    }
}
